
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<style>
    #selectPODiv .modal-dialog{
        margin: 80px auto;
    }
    #selectPODiv .form-group select, #selectPODiv .form-group input {
        width: calc(100vw / 2 - 400px);
    }
    .btn-warning.btn-outline {
        color: #fff;
    }
    .btn-submit{
        background: #2c74fa;
        margin-left: 20px;
        border: none;
        color: #fff;
    }
</style>

<div class="modal" id="selectPODiv" tabindex="-1" role="dialog" aria-hidden="true" style="width: auto;">

    <div class="modal-dialog modal-lg" role="document">

        <div class="modal-content animated bounceInRight">

            <div class="modal-header">
                <h4 class="modal-title">修改入库单行信息</h4>
                <button type="button" class="close" data-dismiss="modal"
                        aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>

            <div class="modal-body" style="padding-bottom: 20px; padding-top: 5px;">

                <jsp:include page="search/poSearch.jsp"></jsp:include>

                <div class="col-md-6">
                    <div class="form-group">
                        <span>&nbsp</span>
                        <label>入库数量：</label>
                        <input id="input_quantity" name="input_quantity" type="text" class="form-control" value="">
                    </div>
                </div>

                <div class="col-md-6">
                    <div class="form-group">
                        <span>&nbsp</span>
                        <label>损耗数量：</label>
                        <input id="loss" name="loss" type="text" class="form-control" value="">
                    </div>
                </div>

                <div class="col-md-6">
                    <div class="form-group">
                        <span>&nbsp</span>
                        <label>赠送数量：</label>
                        <input id="attached" name="attached" type="text" class="form-control" value="">
                    </div>
                </div>

                <div class="col-md-6">
                    <div class="form-group">
                        <span>&nbsp</span>
                        <label>赠送说明：</label>
                        <input id="attached_memo" name="attached_memo" type="text" class="form-control" value="">
                    </div>
                </div>

                <div class="col-md-12">
                    <div class="form-group row m-b-none">
                        <div class="col-sm-10 col-sm-offset-2 text-right">
                            <button class="btn btn-white btn-lg" type="button" data-dismiss="modal">返回</button>
                            &nbsp;
                            <button id="selectButton" class="btn btn-submit" data-style="expand-right">
                               确定
                            </button>
                        </div>
                    </div>
                </div>

            </div>

        </div>

    </div>

</div>

<script>
    $(document).ready(function() {
        //初始化checkbox
        $('.i-checks').iCheck({
            checkboxClass : 'icheckbox_square-green',
            radioClass : 'iradio_square-green',
        });


        //checkbox选中效果
        $("tr").click(function(){
            if($(this).find(".i-checks").prop("checked")){
                $(this).find(".i-checks").iCheck('uncheck');
            }else{
                $(".i-checks").iCheck('uncheck');
                $(this).find(".i-checks").iCheck('check');
            }

        });

        //查询条件
        $("#searchButton").click(function() {
            if ($("#searchDiv").css("display") == "none") {
                $("#searchDiv").show();
                $("#searchButton").html('<i class="fa fa-search"></i>&nbsp;&nbsp;关闭查询');
                $("#searchButton").addClass("btn-outline btn-warning");
                $("#searchButton").blur();
                $("#searchConfirmButton").show();
            } else {
                $("#searchDiv").hide();
                $("#searchButton").html('<i class="fa fa-search"></i>&nbsp;&nbsp;展开查询');
                $("#searchButton").removeClass("btn-outline btn-warning");
                $("#searchButton").blur();
                $("#searchConfirmButton").hiden();
            }
        });

        //确认按钮
        $("#selectButton").click(function(){

          var a =  $("#input_quantity").val();
            $("#loss").val();
            $("#attached").val();
            $("#attached_memo").val();
            alert(a)

            $('#selectPODiv').modal('hide');
        });
    });

    //跳转页面
    function gotoPage(page){
        var pageNumber = 1;
        var currentPage = 1;
        //首页和尾页无需跳转
        if((currentPage==1&&page==1)||(currentPage==pageNumber&&page==pageNumber)){

        }else{
            getSelectPOModal(page);
        }
    }
</script>